<?php
namespace app\common\search\tyyh;

/**
 * 提供搜索条件
 */
class Collect extends Base{
	protected $request = 'tyyh\\Collect';

	public function private_list($model) {
		$post = $this->request->getPrivateList();
		if(!$post['isexpire'] || $post['isexpire'] == 'false') {//无法支持分库后连表查询
			$productStatusEnum = loadEnum('ProductStatus');
			$productExamineEnum = loadEnum('ProductExamine');
			$model->alias('C');
			$model->join([loadModel('tysj\\Product')->getTable() => 'P'], 'C.pid = P.id');
			$model->where('P.id > 0');
			$model->where('P.status', $productStatusEnum->code2key('shangjia'));
			$model->where('P.examine', $productExamineEnum->code2key('shenhewancheng'));
		}
	}
}
